
class WebUploader {


    constructor(type, img, url) {
        this.type = type
        this.img = img
        this.url = Feng.ctxPath + url;
        alert(this.type)

    }

    get area() {
        return this.height * this.width;
    }

    set sideLength(newLength) {
        this.height = newLength;
        this.width = newLength;
    }
    init() {
        //layui按需加载
        layui.use('upload', function(){
            var upload = layui.upload;
            var $ = layui.$;
            Feng.info("haha")
            var  upload = upload.render({
                elem: webUploader.img //绑定元素
                ,url: webUploader.url //上传接口
                ,done: function(res){
                    //上传完毕回调
                }
                ,error: function(){
                    //请求异常回调
                }
                ,cceptMime: 'image/*'
                ,accept: 'file' //允许上传的文件类型
                ,size: 5000 //最大允许上传的文件大小
            });

        });
    }
}





